/**
 * Project Reactor
 */


#ifndef _ACCEPTOR_H
#define _ACCEPTOR_H
#include "InetAddress.h"
#include "Socket.h"

class Acceptor {
public: 
    
/**
 * @param port
 */
Acceptor(unsigned short port);
Acceptor(string ip, unsigned short port);
    
/**
 * @param on
 */
void setReuseAddr(bool on);
    
/**
 * @param on
 */
void setReusePort(bool on);
    
void bind();
    
void listen();
    
int accept();
    
void ready();

int fd();
private: 
    InetAddress _addr;
    Socket _sock;
};

#endif //_ACCEPTOR_H
